<template>
    <ul class="report-list">
        <li class="item" data-bgdh="'+item.id+'" v-for="(item,index) in listData"  :key="index" @click="toDetail(item)">
            <p class="title">{{item.yymc}}</p>
            <p class="time"><span class="checkTime">就诊时间：  {{item.bgrq}} </span></p>
            <div class="subject">
                <p class="fl">检验：<span class="type">{{item.bgdlbmc}}</span></p>
                <p class="fr"><img src="../assets/images/arrow-right.png" alt=""></p>
                
            </div>
        </li>
        <div class="null" v-show="!listData[0]">暂无相关内容</div>
    </ul>
</template>

<script>
export default {
    name: 'listExample',
    data () {
        return {
        }
    },
    methods:{
        toDetail(item){
            // window.location.href="./jybg-detail.html?id="+id 
            if(this.type == 'jybg'){
                this.$router.push({
                    path: '/jybg/detail',
                    query:{}
                })
                localStorage.setItem('mzjbxx',  JSON.stringify(item))
            } else if(this.type == 'jcbg'){
                 this.$router.push({
                    path: '/jcbg/detail',
                    query:{
                    }
                })
                localStorage.setItem('mzjbxx',  JSON.stringify(item))
            }
            
        },
    },
    props:[
        'listData','type'
    ],
    filters:{
        filterTime:val=>{
            if(val){
                return val.replace('T',' ').replace('Z','') 
            }
            
        }
    },
    created(){
    }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
a {
  color: #42b983;
}
.null{
    line-height: 6rem;
    background: #fff;
    text-align: center;
}
.fl{
    float: left;
}
.fr{
    float: right;
}
.item{
    margin-bottom:0.6rem;
    background: #fff;
    .title{
        font-size: 1.3rem;
        color:#333;
        padding-top:1rem;
    }
    p{
        font-size: 1rem;
        color:#999999;
        padding:0 1rem;
    }
    .time{
        margin-bottom:0.5rem;
    }
    .subject{
        // padding:0 1rem;
        border-top: #DDDDDD solid 1px;
        line-height: 3rem;
        overflow: hidden;
        p{
            margin-top:0;
        }
        span{
            color:#333;
        }
    }
    img{
        width: 0.6rem;
        vertical-align: middle;
        
    }
}

</style>
